import request from '@/utils/request'

// 获取权限列表
export function permissionList(params) {
  return request({
    method: 'get',
    url: '/permissions',
    params
  })
}

// 添加权限
export function addPermission(data) {
  return request({
    method: 'post',
    url: '/permissions',
    data
  })
}

// 根据id删除
export function delPermission(id) {
  return request({
    method: 'delete',
    url: '/permissions/' + id
  })
}

// 根据id获取权限详情
export function getPermissionById(id) {
  return request({
    method: 'get',
    url: '/permissions/' + id
  })
}

// 根据id更新权限详情
export function editPermissionById(data) {
  return request({
    method: 'put',
    url: '/permissions/' + data.id,
    data
  })
}
